﻿using Rafy;
using Rafy.ComponentModel;
using Rafy.Data;
using Rafy.Domain;
using Rafy.Domain.ORM;
using Rafy.Domain.ORM.Query;
using Rafy.Domain.Validation;
using Rafy.ManagedProperty;
using Rafy.MetaModel;
using Rafy.MetaModel.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Security.Permissions;
using System.Text;

namespace Rafy.YuWen
{
    /// <summary>
    /// 实体的领域名称
    /// </summary>
    [RootEntity]
    public partial class Base_Words : YuWenEntity
    {
        #region 引用属性

        #endregion

        #region 组合子属性

        #endregion

        #region 一般属性
        public static readonly Property<string> F_NameProperty = P<Base_Words>.Register(e => e.F_Name);
        /// <summary>
        /// 名称
        /// </summary>
        public string F_Name
        {
            get { return this.GetProperty(F_NameProperty); }
            set { this.SetProperty(F_NameProperty, value); }
        }
        public static readonly Property<string> F_PinYinProperty = P<Base_Words>.Register(e => e.F_PinYin);
        /// <summary>
        /// 拼音
        /// </summary>
        public string F_PinYin
        {
            get { return this.GetProperty(F_PinYinProperty); }
            set { this.SetProperty(F_PinYinProperty, value); }
        }

        public static readonly Property<int> F_NameLenProperty = P<Base_Words>.Register(e => e.F_NameLen);
        /// <summary>
        /// 词语长度
        /// </summary>
        public int F_NameLen
        {
            get { return this.GetProperty(F_NameLenProperty); }
            set { this.SetProperty(F_NameLenProperty, value); }
        }
        public static readonly Property<int> F_ClassProperty = P<Base_Words>.Register(e => e.F_Class);
        /// <summary>
        /// 该词在几年级中学习到
        /// </summary>
        public int F_Class
        {
            get { return this.GetProperty(F_ClassProperty); }
            set { this.SetProperty(F_ClassProperty, value); }
        }

        public static readonly Property<string> F_PinYinsProperty = P<Base_Words>.Register(e => e.F_PinYins);
        /// <summary>
        /// 拼音无音节
        /// </summary>
        public string F_PinYins
        {
            get { return this.GetProperty(F_PinYinsProperty); }
            set { this.SetProperty(F_PinYinsProperty, value); }
        }
        public static readonly Property<int> F_StrokesProperty = P<Base_Words>.Register(e => e.F_Strokes);
        /// <summary>
        /// 该词多少笔画
        /// </summary>
        public int F_Strokes
        {
            get { return this.GetProperty(F_StrokesProperty); }
            set { this.SetProperty(F_StrokesProperty, value); }
        }
        public static readonly Property<string> F_JinYiCiProperty = P<Base_Words>.Register(e => e.F_JinYiCi);
        /// <summary>
        /// 近义词
        /// </summary>
        public string F_JinYiCi
        {
            get { return this.GetProperty(F_JinYiCiProperty); }
            set { this.SetProperty(F_JinYiCiProperty, value); }
        }

        public static readonly Property<string> F_FanYiCiProperty = P<Base_Words>.Register(e => e.F_FanYiCi);
        /// <summary>
        /// 反义词
        /// </summary>
        public string F_FanYiCi
        {
            get { return this.GetProperty(F_FanYiCiProperty); }
            set { this.SetProperty(F_FanYiCiProperty, value); }
        }
        public static readonly Property<string> F_JieShiProperty = P<Base_Words>.Register(e => e.F_JieShi);
        /// <summary>
        /// 解释
        /// </summary>
        public string F_JieShi
        {
            get { return this.GetProperty(F_JieShiProperty); }
            set { this.SetProperty(F_JieShiProperty, value); }
        }

        public static readonly Property<string> F_FaYinProperty = P<Base_Words>.Register(e => e.F_FaYin);
        /// <summary>
        /// 发音地址
        /// </summary>
        public string F_FaYin
        {
            get { return this.GetProperty(F_FaYinProperty); }
            set { this.SetProperty(F_FaYinProperty, value); }
        }

        public static readonly Property<string> F_PicProperty = P<Base_Words>.Register(e => e.F_Pic);
        /// <summary>
        /// 展示图
        /// </summary>
        public string F_Pic
        {
            get { return this.GetProperty(F_PicProperty); }
            set { this.SetProperty(F_PicProperty, value); }
        }

        public static readonly Property<string> F_VideoProperty = P<Base_Words>.Register(e => e.F_Video);
        /// <summary>
        /// 视频地址
        /// </summary>
        public string F_Video
        {
            get { return this.GetProperty(F_VideoProperty); }
            set { this.SetProperty(F_VideoProperty, value); }
        }
        #endregion

        #region 只读属性

        #endregion
    }

    /// <summary>
    /// 实体的领域名称 列表类。
    /// </summary>
    public partial class Base_WordsList : YuWenEntityList<Base_Words> { }

    /// <summary>
    /// 实体的领域名称 仓库类。
    /// 负责 实体的领域名称 类的查询、保存。
    /// </summary>
    public partial class Base_WordsRepository : YuWenEntityRepository
    {
        /// <summary>
        /// 单例模式，外界不可以直接构造本对象。
        /// </summary>
        protected Base_WordsRepository() { }
    }

    /// <summary>
    /// 实体的领域名称 配置类。
    /// 负责 实体的领域名称 类的实体元数据的配置。
    /// </summary>
    internal class Base_WordsConfig : YuWenEntityConfig<Base_Words>
    {
        /// <summary>
        /// 配置实体的元数据
        /// </summary>
        protected override void ConfigMeta()
        {
            //配置实体的所有属性都映射到数据表中。
            Meta.MapTable().MapAllProperties();
        }
    }
}